<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Object.fromEntries</title>
</head>

<body>

  <script>
    /* // 二维数组 
    const result = Object.fromEntries([
      ['name', '尚硅谷'],
      ['xueke', 'Java', 'Vue']
    ])
    console.log(result); // {name: '尚硅谷', xueke: 'Java'} */

    // Map
    const m = new Map();
    m.set('name', 'ATGUIGU');

    const result = Object.fromEntries(m);
    console.log(result); // { name: 'ATGUIGU' }
  </script>
</body>

</html>